

#include "widget.h"
#include<QDateTime>
#include <QApplication>
#include<QSplashScreen>


int main(int argc, char* argv[])
{
    QApplication a(argc, argv);
    Widget w;
    QPixmap pixmap("://tupian/kaishi.png");
    QSplashScreen*sp=new QSplashScreen(pixmap);
    sp->show();
    QDateTime time=QDateTime::currentDateTime();
    QDateTime curTime=QDateTime::currentDateTime();
    qDebug()<<time.secsTo(curTime);
    while(time.secsTo(curTime)<=5){
        QString str=QString("%1:%2").arg("软件正在疯狂加载中").arg(QString::number(time.secsTo(curTime)));
        sp->showMessage(str,Qt::AlignCenter,Qt::red);
        curTime=QDateTime::currentDateTime();
        a.processEvents();
    }
    w.show();
    sp->finish(&w);
    delete sp;
    sp=nullptr;
    return a.exec();

}

